- frontpage_fragment_cache("list_item", listing) do
  .home-list-item
    - if listing.listing_images.size > 0
      = link_to listing_path(listing.url), :class => "home-list-image-container-desktop" do
        = image_tag listing.listing_images.first[:small_3x2], {:alt => listed_listing_title(listing), :class => "home-list-image"}
    - if listing.listing_images.size > 0
      = link_to listing_path(listing.url), :class => "home-list-image-container-mobile" do
        = image_tag listing.listing_images.first[:thumb], {:alt => listed_listing_title(listing), :class => "home-list-image"}
    .home-list-details-right
      .home-list-price
        - if listing.price
          .home-list-item-price-value
            = MoneyViewUtils.to_humanized(listing.price)
          - price_text = nil
          - if listing.quantity.present?
            - price_text = t("listings.form.price.per") + " " + listing.quantity
          - elsif listing.unit_type
            - price_text = price_quantity_per_unit(listing)

          - if price_text.present?
            .home-list-price-quantity{:title => price_text}
              = price_text
        - else
          .home-list-listing-shape-value
            = shape_name(listing)

    %div{:class => (listing.listing_images.size > 0 ? "home-list-details-with-image" : "")}
      %h2.home-list-title
        = link_to listing_path(listing.url) do
          = listing.title
          - if @current_community.show_category_in_listing_list
            %a.home-share-type-link{:href => search_path(:transaction_type => shape_name_map[listing.listing_shape_id], :view => :list)}
              = icon_tag(listing.icon_name, ["icon-fix"])
              = shape_name(listing)
      .home-list-price-mobile{:class => (listing.listing_images.size > 0 ? "home-list-price-mobile-with-listing-image" : "home-list-price-mobile-without-listing-image")}
        - if listing.price
          .home-list-price-value-mobile
            = MoneyViewUtils.to_humanized(listing.price)
          - price_text = nil
          - if listing.quantity.present?
            - price_text = t("listings.form.price.per") + " " + listing.quantity
          - elsif listing.unit_type
            - price_text = price_quantity_per_unit(listing)
          - if price_text.present?
            .home-list-price-quantity{:title => price_text}
              = price_text
        - else
          .home-list-shape-value-mobile
            = shape_name(listing)


    .home-list-author{:class => (listing.listing_images.size > 0 ? "home-list-author-with-listing-image" : "home-list-author-without-listing-image")}
      .home-list-avatar
        = link_to(person_path(username: listing.author.username), :class => "home-fluid-thumbnail-grid-author-avatar-image") do
          = image_tag(listing.author.avatar.thumb || missing_avatar(:thumb))
      .home-list-author-details
        = link_to(person_path(username: listing.author.username), :class => "home-list-author-name") do
          = PersonViewUtils.person_entity_display_name(listing.author, @current_community.name_display_type)
        .home-list-author-reviews
          - if listing.author.num_of_reviews > 0
            = icon_tag("testimonial")
            = pluralize(listing.author.num_of_reviews, t(".review"), t(".reviews"))
